//
//  UINavigationController+CycleNaviExtension.m
//  CycleControlFunction
//
//  Created by 苹果笔记本 on 2020/5/13.
//  Copyright © 2020 cycle. All rights reserved.
//

#import "UINavigationController+CycleNaviExtension.h"

@implementation UINavigationController (CycleNaviExtension)

- (void)cycle_setDeafultNaviBar
{
    //设置导航栏颜色
    UINavigationBar *bar = self.navigationBar;
    bar.translucent = NO;
    bar.hidden = NO;
    //从新老系统进来的导航条背景色不一样
//    if([self isKindOfClass:[DXNavigationController class]])
//    {
//        //新系统
//        bar.barTintColor = NaviBackgroundColor;
//    }else
//    {
//        //老系统
//        bar.barTintColor = NavColor;
//    }
    
    bar.tintColor = [UIColor whiteColor];
    [bar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
}
- (void)cycle_setWhiteNaviBar
{
    //设置导航栏颜色
    UINavigationBar *bar = self.navigationBar;
    bar.hidden = NO;
    bar.translucent = NO;
    bar.barTintColor = [UIColor whiteColor];
    bar.tintColor = [UIColor whiteColor];
    [bar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    bar.shadowImage = [UIImage new];
    [bar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
}
- (void)cycle_setClearNaviBar
{
    //设置导航栏颜色
    UINavigationBar *bar = self.navigationBar;
    bar.hidden = YES;
    bar.translucent = YES;
    //    bar.barTintColor = [UIColor clearColor];
    //    bar.tintColor = [UIColor clearColor];
    //    [bar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor clearColor]}];
    [bar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    bar.shadowImage = [UIImage new];
}
- (void)cycle_setDDJHomeViewBar
{
    //设置导航栏颜色
    UINavigationBar *bar = self.navigationBar;
    bar.translucent = YES;
    //    bar.barTintColor = [UIColor clearColor];
    //    bar.tintColor = [UIColor clearColor];
    //    [bar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor clearColor]}];
    [bar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    bar.shadowImage = [UIImage new];

}
- (void)cycle_setNaviBarLineHidden;
{
    [self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:[UIImage new]];
    
}

- (void)cycle_setNaviBarLineShow;
{
    [self.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:nil];
    
}

@end
